package test;
import java.util.Scanner;
//获取11位手机号码对中间4位数字进行屏蔽
//例如：  19994599234->199****9234
public class test12BlockNumber {
    public static void main(String[] args) {
        System.out.println("请输入手机号");
        Scanner scanner=new Scanner(System.in);
        String phoneNumber=scanner.next();
        if(phoneNumber.length()!=11){
            System.out.println("输入的手机号无效请检查手机号是否为11位数");
            System.out.println("您当前输入的手机号为"+phoneNumber.length()+"位数");

        }else{
            String start = phoneNumber.substring(0, 3);
            String end=phoneNumber.substring(7,11);
            String result=start+"****"+end;
            System.out.println(result);
        }
    }
}
